/**
 * 
 */
package com.pmsco.pms.core.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * @author Long Tran
 *
 */
@Entity
@Table(
	name = "MEDICINE_CATEGORY"
)
public class MedicineCategory {
	private Long id;
	private String mainCategory;
	private Medicine medicine;
	private Category category;
	private SubCategory subCategory;
	
	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue
	@Column(name = "ID", nullable = false)
	public Long getId() {
		return id;
	}
	
	/**
	 * @param id the id to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * @return the mainCategory
	 */
	@Column(name = "MAIN_CATEGORY")
	public String getMainCategory() {
		return mainCategory;
	}

	/**
	 * @param mainCategory the mainCategory to set
	 */
	public void setMainCategory(String mainCategory) {
		this.mainCategory = mainCategory;
	}

	/**
	 * @return the medicine
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MEDICINE_ID", nullable = false, updatable = false)
	public Medicine getMedicine() {
		return medicine;
	}

	/**
	 * @param medicine the medicine to set
	 */
	public void setMedicine(Medicine medicine) {
		this.medicine = medicine;
	}

	/**
	 * @return the category
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CATEGORY_ID", nullable = false, updatable = false)
	public Category getCategory() {
		return category;
	}

	/**
	 * @param category the category to set
	 */
	public void setCategory(Category category) {
		this.category = category;
	}

	/**
	 * @return the subCategory
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SUBCATEGORY_ID", nullable = false)
	public SubCategory getSubCategory() {
		return subCategory;
	}

	/**
	 * @param subCategory the subCategory to set
	 */
	public void setSubCategory(SubCategory subCategory) {
		this.subCategory = subCategory;
	}
}
